<?php
/**
 * Created by PhpStorm.
 * User: Adminstratot
 * Date: 2018/11/6
 * Time: 19:36
 */
namespace Admin\Model;
use Think\Model;

class ArticleModel extends Model{
    protected $connection = 'DB_DATA';//连接默认数据库时不写即可

    protected $trueTableName = 'article';
    protected $insertFields = 'title,content,cid,uid,label,is_top';

    protected $_auto = array(
        array('time','time',3,'function'),
    );

    protected $_validate = array(
        array('title','1,50','标题长度不符合要求',1,'length','3'),
        array('label','1,50','标签长度不符合要求',1,'length',3),
        array('content','require ','正文内容不能为空',1,'',3),
    );
}
?>